Interpolation and decimation of sampled data is frequently necessary. A very common example is the ‘re-scaling’ of all or part of digitally-represented television images in a digital video effects (DVE) processor forming part of a vision mixer (or ‘production switcher’).
In a DVE it is highly advantageous to vary the portrayed size (and/or shape) of all or part of an image smoothly from an enlarged representation to a shrunken representation, or vice versa. This is achieved by increasing the number of spatial image samples by interpolation when enlargement is needed, and reducing the number of samples by decimation when shrinking is needed. The degree of interpolation or decimation depending, of course, on the degree of enlargement or shrinking required.
Patent GB 2 418 092 describes a convenient decimation architecture in which an input to be decimated is connected in parallel to a fixed number of coefficient multipliers whose outputs are respectively connected to members of a serially-connected, fixed-length chain of accumulators. Accumulated values are passed along the chain at the required, decimated output rate, and the decimation factor can be varied by changing the number of times that weighted input samples from the multipliers are accumulated. However, this architecture does not permit interpolation and so a process that is required to either interpolate or decimate at will (and smoothly change from interpolation to decimation) requires an additional interpolator, having its output co-timed with the decimator output, and means to take the output from either the interpolator or the decimator. The present invention provides an effective solution to this problem.
The invention is applicable to any type of sampled data. Typically it is applied to spatially or temporally sampled data. In this specification the terms sample (or sampling) frequency, sample pitch and sample phase will be used. Sampling frequency, or sampling rate, is the number of samples that represent some fixed quantity of data. Where spatial sampling is used the frequency will be a spatial frequency, for example samples per active picture width. Where temporal sampling is used the frequency will be samples per second. Sample pitch is the distance between adjacent samples; this is the reciprocal of the sampling frequency. In the case of spatial sampling the pitch is a distance, for example a fraction of the length of an active television line. In the case of temporal sampling the sample pitch is the time period between successive sampling instants. A particular sample phase value represents: a particular point, for spatial sampling; or, a particular instant, for temporal sampling. The skilled person will appreciate that, in the description which follows, the terms ‘time’ and ‘frequency’ may relate to analogous spatial or temporal processes.
The principle of the invention enables a sequence of sample values that represents some quantity, for example a set of luminance values for pixels of an image, to be processed to obtain a modified sequence having fewer or more sample values.
It is helpful, first, to review briefly the known art of interpolation and decimation. FIG. 1 shows how an arbitrarily-positioned, new output sample (1) is constructed from a sequence of input samples (2) by forming its value from a weighted sum of the values of input samples that fall within a filter aperture centred on the position of the new output sample. In the Figure, the sequence of samples is shown horizontally from left to right; vertically aligned features in the figure have the same sampling phase. The positions of input samples are shown by crosses, individual input samples are identified by upper-case letters and the output sample position is shown by a small circle. The filter aperture centred on the output sample (1) is indicated by the brace (3).
In the illustrated example the filter aperture encompasses input samples A to F inclusive, and the value of the output sample (1) is formed from a weighted sum of the values of these input samples:A·α(φA)+B·α(φB)+C·α(φC)+D·α(φD)+E·α(φE)+F·α(φF)                Where: α(x) is the filter aperture function so that the value of the function is the weight, and the argument x of the function is the phase of the sample to be weighted; and,                    φn is the phase of input sample n with respect to the aperture position.                        
Note that, as will be explained below, a wider or narrower filter aperture may be chosen as more appropriate for a particular application.
FIG. 2 shows an exemplary filter aperture. The horizontal (x) axis represents input sample phase relative to the required output sample position. The vertical (y) axis represents the filter coefficient value at a particular input sample phase. The coefficient value at the output sample position is shown as unity, but, as the skilled person will appreciate, the whole aperture magnitude may be normalised to achieve a required gain for the resampling process. The phase axis is calibrated in units of aperture width relative to the output sample position, where the aperture width is the range of phase values outside which the value of the aperture function is zero. Thus the start position of the aperture, (4) in FIG. 1, has the phase value −½; the finishing position of the aperture, (5) in FIG. 1, has the phase value +½; and, the output sample position, (1) in FIG. 1, has the phase value zero.
As is well-known, the filter aperture function is chosen to avoid aliasing. The required aperture function is the impulse response of a filter that attenuates any alias components to an acceptably low level. According to the well-known principles of FIR filter design, the width of a filter aperture is a compromise between: the number of samples included in the aperture (a larger number requires more contribution weights to be evaluated and summed); and, the maximum rate of cut of the filter with respect to input frequency, and the flatness of the passband (a wider aperture allowing sharper cut and flatter response). The skilled person will thus choose an appropriate aperture width for a particular resampling process according to the respective input and output sampling frequencies and the relative acceptability of aliasing and distortion of the wanted signal frequency spectrum. Usually the aperture width is an integral number of input sample pitches, as this simplifies evaluation of the input sample phase values, and hence the determination of the respective sample weights.